<?php
//error_reporting(0);
$dirname = dirname(__FILE__);
define('APP_DIR', $dirname);
define('NO_LEGACY_FLEAPHP', true);
//define('DEPLOY_MODE', true);
require('./FLEA/FLEA.php');

$configFilename = APP_DIR . '/_Shared/DSN.php';
define('SHARED_DIR', dirname(realpath($configFilename)));

$appInf = array(
    'view' => 'FLEA_View_Smarty',
    'viewConfig' => array(
        'smartyDir'         => realpath($dirname . '/Stuff/Smarty'),
        'template_dir'      => $dirname . '/View/Admin',
        'compile_dir'       => $dirname . '/templates_c/Admin',
        'left_delimiter'    => '{{',
        'right_delimiter'   => '}}',
    ),
    'webControlsExtendsDir' => APP_DIR . '/WebControls',
);

FLEA::loadAppInf($configFilename);
FLEA::loadAppInf($appInf);
FLEA::loadAppInf(APP_DIR . '/Config/Admin/BO_APP_INF.php');
FLEA::loadAppInf(APP_DIR . '/Config/Class_INF.php');
FLEA::loadAppInf(APP_DIR . '/Config/SiteInfo.php');
FLEA::import(APP_DIR);
FLEA::runMVC();

function onDispatcherFailedCallback($controller,$action){
	redirect(url('Admin_Default','Index'));
}

function onAuthFailedCallback($controller,$action){
	redirect(url('Admin_Login','Index'));	
}

?>